//
//  WJQSubNextTableViewCell.m
//  TripTogether
//
//  Created by dllo on 15/12/30.
//  Copyright © 2015年 王军岐. All rights reserved.
//

#import "WJQSubNextTableViewCell.h"
#import "WJQdetail_listModel.h"

@interface WJQSubNextTableViewCell ()
@property (nonatomic,strong)UIImageView *myImageView;
@property (nonatomic,strong)UILabel *myLabel;
@property (nonatomic,strong)UIImageView *sanjiaoView;
@end


@implementation WJQSubNextTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatView];
    }
    return  self;
}

- (void)creatView{

    
    self.backgroundColor = [UIColor colorWithRed:0.980 green:0.961 blue:0.910 alpha:1.000];
    self.myImageView = [UIImageView new];
  //  self.myImageView.backgroundColor = [UIColor colorWithRed:0.970 green:1.000 blue:0.062 alpha:1.000];
    
    
    [self.contentView addSubview:self.myImageView];
    
    [self.myImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(0);
        make.left.mas_equalTo(self).offset(20);
        make.height.mas_equalTo(100);
        make.width.mas_equalTo(SCREEN_WIDTH);
        
    }];
    
    
    
    [self.contentView addSubview:self.myLabel];
    
    _myLabel = [UILabel new];
    //_myLabel.backgroundColor = [UIColor redColor];
    [self addSubview:_myLabel];
    [_myLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.myImageView);
        make.top.mas_equalTo(self.myImageView.mas_bottom).offset(11);
        make.height.mas_equalTo(30);
        make.right.mas_equalTo(self.myImageView).offset(-5);
        
    }];
    
    
    
    
     self.sanjiaoView= [UIImageView new];
    [self addSubview:self.sanjiaoView];
   // self.sanjiaoView.backgroundColor = [UIColor colorWithRed:0.812 green:0.753 blue:1.000 alpha:1.000];
    [self.sanjiaoView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(20, 17));
        // make.top.mas_equalTo(self.myImageView).offset(100);
        make.left.mas_equalTo(self.myImageView.mas_left).offset(35);
        make.bottom.mas_equalTo(self.myImageView.mas_bottom).offset(6);
        
    }];
    
    self.sanjiaoView.image = [UIImage imageNamed:@"iconfont-iconfontordinaryshangjiantou-2.png"];
    
    
    

  
    
   
    
    
    
    
    
   // self.backgroundColor = [UIColor colorWithRed:arc4random() % 256 / 255.f green:arc4random() % 256 / 255.f blue:arc4random() % 256 / 255.f alpha:1.f];
    
}
- (void)setListMod:(WJQdetail_listModel *)listMod{
    
    [self.myImageView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(listMod.photo_height);
        make.width.mas_equalTo(listMod.photo_width);

        
    }];
    
    
    [self.myImageView sd_setImageWithURL:[NSURL URLWithString:listMod.photo_s] placeholderImage:PICHOLDEER];
    
    
    self.myLabel.numberOfLines = 0;
    self.myLabel.text = listMod.text;
    [self.myLabel mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(listMod.lableHeight);
        //make.width.mas_equalTo(150);
        
    }];
    self.myLabel.font = [UIFont fontWithName:@"Gill Sans" size:16];
    self.myLabel.textColor = [UIColor colorWithRed:0.259 green:0.259 blue:0.263 alpha:0.900];
    
    
    
    
    
    
    
    
   }

- (void)setisHidden:(BOOL)hidden
{
    //_myLabel.text = str;
  //  self.sanjiaoView.image = hidden;
    //_myButton.hidden = hidden;
    self.sanjiaoView.hidden = hidden;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
